// Author: combacsa@kaist.ac.kr
// http://www.jungol.co.kr/prog/Hanal/hanalView.php?qs_code=1284
// 난이도: 최하

//#define COMPILE_P1284
#ifdef COMPILE_P1284

#include <fstream>

using namespace std;

int data[10];

void input() {
	ifstream in("input.txt");
	for (int i = 0; i < 10; i++)
		in >> data[i];
	in.close();
}

void solve() {
	for (int i = 0; i < 10; i++)
		data[i] = data[i] % 42;
}

void output() {
	ofstream out("output.txt");
	for (int i = 0; i < 10; i++)
		out << data[i] << "\n";
	out.close();
}

int main() {
	input();
	solve();
	output();
    return 0;
}


#endif
